package A14;


public class Cash extends Payment {
    private double cashTendered; // 实际支付金额

    public Cash(double amount, double cashTendered) {
        super(amount);
        this.cashTendered = cashTendered;
    }

    // 计算找零
    public double getChange() {
        return cashTendered - getAmount();
    }

    // getter/setter
    public double getCashTendered() {
        return cashTendered;
    }

    public void setCashTendered(double cashTendered) {
        this.cashTendered = cashTendered;
    }
}
